package com.nuanshui.heatedloan.dao.cms.security;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import com.nuanshui.heatedloan.entity.cms.security.Module;


public interface ModuleDao extends JpaRepository<Module, Long>,
		JpaSpecificationExecutor<Module> {

	Page<Module> findByParentId(Long parentId, Pageable pageable);

	Page<Module> findByParentIdAndNameContaining(Long parentId, String name,
			Pageable pageable);

	@Query("from Module m order by m.priority ASC")
	List<Module> findAllWithCache();
}
